<template>
    <div>
      <div class="list-product-en main-width">
        <span class="theme-color theme-border-color" id="en-title">BRANDS</span>
      </div>
      <div class="list-main main-width">
        <div class="list-nav">
          <div class="name-box " id="big-title"><span class="theme-color">走进天赋能</span></div>
          <ul class="nav-item">
            <!--管理列表-->
            <li v-for="item in tfn" :class="item.id==selectedId?'active':''" @click="setNavItem(item.route)"><nuxt-link :to="item.route">{{item.name}}</nuxt-link></li>
          </ul>
        </div>
        <div class="main-content">
          <nuxt/>
        </div>
      </div>
    </div>
</template>

<script>
  export default {
    name: 'tfn',
    data(){
      return {
        selectedId:'',
        tfn:[
          {
            id:1,
            name:'产业介绍',
            route:'/details/tfn/intro'
          },
          {
            id:2,
            name:'总裁寄语',
            route:'/details/tfn/speech'
          },
          {
            id:3,
            name:'领导团队',
            route:'/details/tfn/team'
          },
          {
            id:4,
            name:'企业文化',
            route:'/details/tfn/culture'
          },
          {
            id:5,
            name:'企业资质',
            route:'/details/tfn/honor'
          }
        ]
      }
    },
    methods:{
      setNavItem(path){
        let path_n = path.split('/')[3];
        let tfn = this.tfn;
        for(let i in tfn){
          if(path_n == tfn[i].route.split('/')[3]){
            this.selectedId = tfn[i].id
          }
        }
      }
    },
    mounted(){
      this.setNavItem(this.$route.path);
    }
  }
</script>

<style scoped lang="less">
  .list-main{
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
  }
  .name-box{
    width: 100%;
    height:0.69rem;
    position: relative;
    font-size: 0.22rem;
    border-bottom: 1px solid #d4d2d3;
  }
  .name-box span{
    position: absolute;
    left: 0;
    bottom:0.08rem;
  }
  .list-product-en{
    height:0.68rem;
    border-bottom:1px solid #afafaf;
    font-size: 0.28rem;
    position: relative;
  }
  .list-product-en span{
    position: absolute;
    padding:0 20px 15px 0;
    bottom:-3px;
    left: 0;
    border-bottom-style:solid;
    border-bottom-width:3px;
  }
  .list-nav{
    width: 25.4%;
  }
  .nav-item{
    font-size: 0.15rem;
  }
  .main-content{
    width: 67.6%;
  }
  .nav-item li{
    height:0.41rem;
    box-sizing: border-box;
    padding-left:0;
    line-height: 0.41rem;
    border-bottom: 1px solid #d4d2d3;
    cursor:pointer;
  }
  .nav-item li a{
    outline: none;
    display: block;
  }
  .nav-item li a:hover{
    background: #006938;
    padding-left:1rem;
    transition: padding-left 1s;
  }
  .nav-item li.active a{
    background: #006938;
    padding-left:1rem;
  }
  .nav-item li:hover a{
    color:#fff;
  }
  .nav-item li.active a{
    color:#fff;
  }
</style>
